// import './index.scss';
import CONSTANT from '@/common/constants.js';
import http from '@/common/http.js';
// import XProgress from 'vux/src/components/x-progress/index.vue'
// import Flexbox from 'vux/src/components/flexbox/flexbox.vue'
// import FlexboxItem from 'vux/src/components/flexbox/flexbox-item.vue'
import Swiper from 'vux/src/components/swiper/swiper.vue'
import SwiperItem from 'vux/src/components/swiper/swiper-item.vue'
// import Http from "../../common/http";
export default {
  name: 'oneToOneDonation',
  components: {Swiper, SwiperItem},
  data () {
    return {
      oneToOneList: [],
      pageNo: 1,
      pageSize: 5,
      index: 0,
      helpNumber01: '',
      recipient01: '',
      helpNumber02: '',
      recipient02: '',
      helpNumber03: '',
      recipient03: '',
      helpNumber04: '',
      recipient04: '',
      waitHelp01: '',
      waitHelp02: '',
      waitHelp03: '',
      waitHelp04: ''
    }
  },
  mounted () {
    if (this.$emit('ifOpenid')) {
      this.$emit('ifOpenid', this.$route.path)
    }
    http.post(CONSTANT.BIUNIQUE, {pageNo: this.pageNo, pageSize: this.pageSize}, (res) => {
      console.log(res)
      if (res.code == 200) {
        this.oneToOneList = res.list
        for (var i = 0; i < this.oneToOneList.length; i++) {
          if (this.oneToOneList[i].id == 'd43202af4647460183fd590c19043d4c') {
            // 小学生
            this.helpNumber01 = this.oneToOneList[i].helpNumber
            this.recipient01 = this.oneToOneList[i].recipient
            this.waitHelp01 = this.oneToOneList[i].waitHelp
          } else if (this.oneToOneList[i].id == 'add99857661342918d50070918835a07') {
            // 初中生
            this.helpNumber02 = this.oneToOneList[i].helpNumber
            this.recipient02 = this.oneToOneList[i].recipient
            this.waitHelp02 = this.oneToOneList[i].waitHelp
          } else if (this.oneToOneList[i].id == 'bb9812e268b1440ba22a142e2dcd416f') {
            // 高中生
            this.helpNumber03 = this.oneToOneList[i].helpNumber
            this.recipient03 = this.oneToOneList[i].recipient
            this.waitHelp03 = this.oneToOneList[i].waitHelp
          } else if (this.oneToOneList[i].id == 'eb783144cf9e47f999708a67d48b576d') {
            // 大学生
            this.helpNumber04 = this.oneToOneList[i].helpNumber
            this.recipient04 = this.oneToOneList[i].recipient
            this.waitHelp04 = this.oneToOneList[i].waitHelp
          }
        }
      }
    })
  },
  methods: {
    goDetails (eid) {
      this.$router.push({path: '/oneToOneDetails',query:{event_id:eid}})
    },
    goprojectDetails (proid) {
      this.$router.push({path: '/Project',query:{event_id:proid}})
    },
    comeBack () {
      window.history.go(-1)
    }
  }
}
